package com.haha.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;

/**
 * Created by Administrator on 2016/6/20 0020.
 */
public class MakeDialog extends Dialog{
    private View LayoutView;
    protected Context context;
    public MakeDialog(Context context) {
        super(context,android.R.style.Theme_Holo_Dialog_MinWidth);
    }

    public MakeDialog(Context context, int layoutResId) {
        this(context);
        this.context = context;
        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        getWindow().setBackgroundDrawableResource(android.R.color.transparent);
        LayoutView = View.inflate(context,layoutResId,null);
        setContentView(LayoutView);
    }

    @Override
    public View findViewById(int id) {
        if(LayoutView == null) return super.findViewById(id);
        else return LayoutView.findViewById(id);
    }
}
